package com.example.springboot.model;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

import java.util.Date;

@Data
@Schema(description = "保存用户参数")
public class UserSaveParam {

    @NotNull(message = "id不能为空")
    @Schema(description = "序号")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @NotBlank(message = "用户账号不能为空")
    @Schema(description = "用户账号")
    @TableField("userId")
    private String userId;

    @NotBlank(message = "密码不能为空")
    @Schema(description = "密码")
    @TableField("passwd")
    private String passwd;

    @NotBlank(message = "名称不能为空")
    @Schema(description = "名称")
    @TableField("username")
    private String username;

    @NotNull(message = "性别不能为空")
    @Schema(description = "性别")
    @TableField("gender")
    private Integer gender;

    @Schema(description = "生日")
    @TableField("birth")
    private Date birth;

    @NotNull(message = "权限不能为空")
    @Schema(description = "权限")
    @TableField("roleId")
    private Integer roleId;

    @NotNull(message = "状态不能为空")
    @Schema(description = "状态")
    @TableField("state")
    private Integer state;
}
